{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "using DensityEstimationML\n",
    "using Distributions\n",
    "using Base.Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "using Plots"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "histogram(original_sample(GenerateDatasets.MagdonIsmailAndAtiya()), nbins=25)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Check against images in Likas 2001 https://pdfs.semanticscholar.org/0aea/e2b793cd05801c1b94052c76e07be48b3139.pdf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "histogram(original_sample(GenerateDatasets.Likas1()), nbins=100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "histogram(original_sample(GenerateDatasets.Likas2()); nbins=200)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "likas_3_samples = original_sample(GenerateDatasets.Likas3())\n",
    "histogram2d(likas_3_samples[1,:], likas_3_samples[2,:], xlims=(-1,2), ylims=(-1,2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0-element Array{Float64,1}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cdf(GenerateDatasets.Likas2(), 8.29237)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1m\u001b[37mTest Summary:                                              | \u001b[39m\u001b[22m\u001b[1m\u001b[32mPass  \u001b[39m\u001b[22m\u001b[1m\u001b[36mTotal\u001b[39m\u001b[22m\n",
      "Sample valid DensityEstimationML.GenerateDatasets.Likas1() | \u001b[32m   1  \u001b[39m\u001b[36m    1\u001b[39m\n",
      "\u001b[1m\u001b[37mTest Summary:                                              | \u001b[39m\u001b[22m\u001b[1m\u001b[32mPass  \u001b[39m\u001b[22m\u001b[1m\u001b[36mTotal\u001b[39m\u001b[22m\n",
      "Sample valid DensityEstimationML.GenerateDatasets.Likas2() | \u001b[32m   1  \u001b[39m\u001b[36m    1\u001b[39m\n",
      "\u001b[1m\u001b[37mTest Summary:                                                            | \u001b[39m\u001b[22m\u001b[1m\u001b[32mPass  \u001b[39m\u001b[22m\u001b[1m\u001b[36mTotal\u001b[39m\u001b[22m\n",
      "Sample valid DensityEstimationML.GenerateDatasets.MagdonIsmailAndAtiya() | \u001b[32m   1  \u001b[39m\u001b[36m    1\u001b[39m\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "3-element Array{Any,1}:\n",
       " Base.Test.DefaultTestSet(\"Sample valid DensityEstimationML.GenerateDatasets.Likas1()\", Any[], 1, false)              \n",
       " Base.Test.DefaultTestSet(\"Sample valid DensityEstimationML.GenerateDatasets.Likas2()\", Any[], 1, false)              \n",
       " Base.Test.DefaultTestSet(\"Sample valid DensityEstimationML.GenerateDatasets.MagdonIsmailAndAtiya()\", Any[], 1, false)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1m\u001b[37mTest Summary:                                                         |\u001b[39m\u001b[22m\n",
      "cdf consistent with pdf DensityEstimationML.GenerateDatasets.Likas2() | \u001b[36mNo tests\u001b[39m\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "1-element Array{Any,1}:\n",
       " Base.Test.DefaultTestSet(\"cdf consistent with pdf DensityEstimationML.GenerateDatasets.Likas2()\", Any[], 0, false)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 0.6.0",
   "language": "julia",
   "name": "julia-0.6"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "0.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
